package com.ruoyi.wechat.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wechat.mapper.ProjectMapper;
import com.ruoyi.wechat.domain.Project;
import com.ruoyi.wechat.service.IProjectService;

/**
 * 营地其他项目表Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class ProjectServiceImpl implements IProjectService 
{
    @Autowired
    private ProjectMapper projectMapper;

    /**
     * 查询营地其他项目表
     * 
     * @param projectId 营地其他项目表主键
     * @return 营地其他项目表
     */
    @Override
    public Project selectProjectByProjectId(String projectId)
    {
        return projectMapper.selectProjectByProjectId(projectId);
    }
    @Override
    public Project selectProjectBycampId(String campId)
    {
        return projectMapper.selectProjectBycampId(campId);
    }

    /**
     * 查询营地其他项目表列表
     * 
     * @param project 营地其他项目表
     * @return 营地其他项目表
     */
    @Override
    public List<Project> selectProjectList(Project project)
    {
        return projectMapper.selectProjectList(project);
    }

    /**
     * 新增营地其他项目表
     * 
     * @param project 营地其他项目表
     * @return 结果
     */
    @Override
    public String insertProject(Project project)
    {
        project.setProjectId((IdUtils.randomUUID()));
        projectMapper.insertProject(project);
        return project.getProjectId();
//        return projectMapper.insertProject(project);
    }

    /**
     * 修改营地其他项目表
     * 
     * @param project 营地其他项目表
     * @return 结果
     */
    @Override
    public int updateProject(Project project)
    {
        return projectMapper.updateProject(project);
    }

    /**
     * 批量删除营地其他项目表
     * 
     * @param projectIds 需要删除的营地其他项目表主键
     * @return 结果
     */
    @Override
    public int deleteProjectByProjectIds(String[] projectIds)
    {
        return projectMapper.deleteProjectByProjectIds(projectIds);
    }

    /**
     * 删除营地其他项目表信息
     * 
     * @param projectId 营地其他项目表主键
     * @return 结果
     */
    @Override
    public int deleteProjectByProjectId(String projectId)
    {
        return projectMapper.deleteProjectByProjectId(projectId);
    }
}
